using System.Collections.Generic;

namespace Nexia.FluentHtmlElements.Utilities
{
	/// <summary>
	/// Represents a class that is used to build HTML elements.
	/// </summary>
	public interface ITagBuilder
	{
		/// <summary>
		/// Gets or sets the collection of attributes for the tag.
		/// </summary>
		IDictionary<string, string> Attributes { get; }

		/// <summary>
		/// Gets or sets the inner HTML for the tag.
		/// </summary>
		string InnerHtml { get; set; }

		/// <summary>
		/// Adds the specified CSS class to the tag-builder attributes.
		/// </summary>
		/// <param name="value">The CSS class value string.</param>
		void AddCssClass(string value);
		
		/// <summary>
		/// Adds an attribute to the tag by using the specified key/value pair.
		/// </summary>
		/// <param name="key">The key.</param>
		/// <param name="value">The value.</param>
		void MergeAttribute(string key, string value);

		/// <summary>
		/// Adds an attribute to the tag by using the specified key/value pair.
		/// </summary>
		/// <param name="key">The key.</param>
		/// <param name="value">The value.</param>
		/// <param name="replaceExisting">true to replace the existing attribute.</param>
		void MergeAttribute(string key, string value, bool replaceExisting);

		/// <summary>
		/// Returns a string that represents the current object.
		/// </summary>
		/// <returns></returns>
		string ToString();

		/// <summary>
		/// Returns a string that represents the current object by using the specified tag-render mode.
		/// </summary>
		/// <remarks>Use this method to render the HTML tag. Using the renderMode parameter, you can render a normal tag, a start tag, an end tag, or a self-closing tag.</remarks>
		/// <param name="renderMode">The tag-render mode.</param>
		/// <returns>A string that represents the current object.</returns>		
		string ToString(TagRenderMode renderMode);
	}
}